package ooday05;
/**枚举的演示 */
public class EnumDemo {
    public static void main(String[] args) {
        Season[] seasons=Season.values();//获取所有枚举的对象
        for (int i = 0; i < seasons.length; i++) {
            System.out.println(seasons[i]);
            System.out.println(seasons[i].getSeasonName());
            System.out.println(seasons[i].getSeasonDesc());
        }
        Season s=Season.SPRING;//获取SPRING对象
        System.out.println(s.getSeasonName()+","+s.getSeasonDesc());
        switch (s){
            case SPRING:
                System.out.println("天气"+s.getSeasonDesc()+",放风筝去啦");
                break;
            case SUMMER:
                System.out.println("天气"+s.getSeasonDesc()+",游泳去啦");
                break;
            case AUTUMN:
                System.out.println("天气"+s.getSeasonDesc()+",摘果子去啦");
                break;
            case WINTER:
                System.out.println("天气"+s.getSeasonDesc()+",打雪仗去啦");
            default:

        }

    }
}
